package com.lagou.demo.controller;

import com.lagou.demo.service.IDemoService;
import com.lagou.edu.mvcframework.annotations.LagouAutowired;
import com.lagou.edu.mvcframework.annotations.LagouController;
import com.lagou.edu.mvcframework.annotations.LagouRequestMapping;
import com.lagou.edu.mvcframework.annotations.LagouSecurity;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

@LagouController
@LagouRequestMapping("/demo")
@LagouSecurity(values = {"daxiong","jingxiang"})
public class DemoController {


    @LagouAutowired
    private IDemoService demoService;


    /**
     * URL: /demo/query?name=lisi
     * @param request
     * @param response
     * @param username
     * @return
     */
    @LagouRequestMapping("/query")
    public String query(HttpServletRequest request, HttpServletResponse response,String username) {
        System.out.println(username + "请求了接口: query ");
        return username;
    }


    @LagouRequestMapping("/check")
    @LagouSecurity(values = {"xiaodingdang"})
    public String check(HttpServletRequest request, HttpServletResponse response,String username) {
        System.out.println(username + "请求了接口: check ");
        return username;
    }

    @LagouRequestMapping("/eat")
    @LagouSecurity(values = {"panghu","xiaofu"})
    public String eat(HttpServletRequest request, HttpServletResponse response,String username) {
        System.out.println(username + "请求了接口: eat ");
        return username;
    }



}
